#include "structures.h"

void push(Mem_list *list, Bloc data)
{
	B_list *newElement;
	newElement = (B_list*) malloc(sizeof(B_list));
	
	newElement->bloc = data;
	newElement->next = NULL;
	newElement->prev = NULL;
	
	if (list->nbBlocks == 0)
	{
		list->first = list->last = newElement;
	}
	else
	{
		list->last->next = newElement;
		newElement->prev = list->last;
		list->last = newElement;
	}
	list->nbBlocks++;
}
